package DbObjects;

public class Person implements java.io.Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = -4721485160071620204L;
	/**
	 * 
	 */
	public int personId;
	public String firstName;
	public String lastName;
	public Address address;
	
	public Person()
	{
		this.personId = 0;
		this.firstName = "";
		this.lastName = "";
		this.setAddress(null);
	}
	
	public Person(int personId, String firstName, String lastName, Address address)
	{
		this.personId = personId;
		this.firstName = firstName;
		this.lastName = lastName;
		this.setAddress(address);
	}
	
	public void setPersonId(int personId) 
	{
		this.personId = personId;
	}
	
	public int getPersonId() 
	{
		return personId;
	}
	
	public void setFirstName(String firstName) 
	{
		this.firstName = firstName;
	}
	
	public String getFirstName() 
	{
		return firstName;
	}
	
	public void setLastName(String lastName) 
	{
		this.lastName = lastName;
	}
	
	public String getLastName() 
	{
		return lastName;
	}
	
	public void setAddress(Address address) 
	{
		this.address = address;
	}

	public Address getAddress() 
	{
		return address;
	}

	@Override
	public String toString()
	{
		StringBuffer buffer = new StringBuffer();
		buffer.append(this.personId + "\t" + this.firstName + " " + this.lastName);
		
		if(this.address != null)
			buffer.append(" " + this.address.toString());
		
		return buffer.toString();
	}
}
